--[[
	获取拔测短信列表中的数据　最大count个
	未使用
--]]

local quereKey = KEYS[1]
local count = tonumber(ARGV[1])

local function main()
	local index = 0
	local array = {}
	
	local keylist = redis.call("keys",quereKey)
	if(keylist ~= nil and keylist ~= "" and keylist ~= false) then
		for i,v in ipairs(keylist) do
			local values = redis.call("hmget",v,"recId","testPhone","testContent","gateLinkId","sendTime","sendResult","smSeq")
			index = index + 1
			array[index] = values
			redis.call("del",v)
			if(index >= count) then
				break
			end
		end
	end
return array
end

return main()